#!/usr/bin/ruby -w
# -*- coding: UTF-8 -*-

=begin 
@author = sirius
@time = 2017.11.11
=end

# 方法
def test1(a1="Ruby", a2="Perl")
   puts "编程语言为 #{a1}"
   puts "编程语言为 #{a2}"
end
test1 "C", "C++"
test1

# return 语句
def test2
   i = 100
   j = 200
   k = 300
return i, j, k
end
var = test2
puts var

# 可变数量的参数
def sample (*test)
   puts "参数个数为 #{test.length}"
   for i in 0...test.length
      puts "参数值为 #{test[i]}"
   end
end
sample "Zara", "6", "F"
sample "Mac", "36", "M", "MCA"

# 类方法
class Accounts
   def reading_charge
   end
   def Accounts.return_date
   	puts "类方法"
   end
end
Accounts.return_date
